package chapter04

import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.sql.{DataFrame, SQLContext}

object SparkContextApp {
  /**
   * spark 1.x
   * @param args
   */
  def main(args: Array[String]): Unit = {
    val conf: SparkConf = new SparkConf().setAppName("SparkContextApp").setMaster("local")
    val sc = new SparkContext(conf)
    val sQLContext = new SQLContext(sc)

    val df: DataFrame = sQLContext.read.text("D:\\JAVApros\\spark_pk\\data\\input.txt")
    df.show()

    sc.stop()


  }
}
